package com.cqhilink.iot.jobstandardmanagement.facade.utils;

/**
 * Created by huangxueqian@cqhilink.com on 2016/12/9.
 * 角色等级设置
 * RoleType_A(0,"系统管理员"),
 RoleType_B(1,"管理员"),
 RoleType_C(2,"普通角色"),
 */
public enum RolesLevel {
    ROLES_O(2,"普通角色"),
    ROLES_B(1,"管理员"),
    ROLES_S(0,"超级管理员"),
    ;
    /** 编码 */
    private int code;
    /** 描述 */
    private String description;

    RolesLevel(int code, String description){
        this.code = code;
        this.description = description;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static String getDescription(int code) {
        for (RolesLevel ce : RolesLevel.values()) {
            if (ce.getCode() == code) {
                return ce.getDescription();
            }
        }
        return null;
    }

}
